package com.example.system.mapper;

import com.baomidou.mybatisplus.core.mapper.BaseMapper;
import com.example.system.entity.Remind;
import org.apache.ibatis.annotations.Delete;
import org.apache.ibatis.annotations.Mapper;
import org.apache.ibatis.annotations.Select;
import org.apache.ibatis.annotations.Update;

@Mapper
public interface RemindMapper extends BaseMapper<Remind> {

    @Delete("DELETE FROM remind WHERE remind_id = #{remindId}")
    int deleteRemindByRemindId(Integer remindId);

    int addRemindByRemind(Remind remind);

    @Select("SELECT * FROM remind WHERE remind_id = #{remindId};")
    Remind findRemindByRemindID(Integer remindId);

    @Update("UPDATE remind SET remind_text = #{remindText},remind_time = #{remindTime},type = #{type} WHERE remind_id = #{remindId};")
    Remind updateRemindByRemindId(Integer remindId);
}
